package com.qf.fronted.payConfig;



/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016102500755363";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCanM1pnA93jxgUROO1c5K7oEnhnzZSGUT9gvacJyrA3B76Bgc6RB97qLevUxh3CTAG9j6FVYhcD375R8s0omXA2hyk1Lniadoerjev8gCrRI6MpdoJcMcuBuq7oDKLs5IIZpP7Z9Z14hDN2zRDaydniE8yBMWJsu7ulw+EFKLFuCVMAPQGfJS9/5GeJDyioTx/Hu7A/L+/QyCn39bnj3zWzwszX89xQI0F1eA57uwQLlEAVep17g3DBlU/Tqj+ctWOvXOfnDbHeUxbhtVaNQwQgMcQMPJdhrIlyICR9ZX9aHXKhRhoK1QJFQ1A5MRXdn6twYTJLTRNE4Sv+/mfKLaRAgMBAAECggEAdIV97Xy2z2UhQY1Vi1eJmyvG4mop9x+iNeiwUKjX+LcsBUPryIa0r25M2K4oPvXGo0iLf9MhTDhFejsYMxe81eXLNpI3cSJTR1IHF+urg2fMgsUvmHPNOKvv1e16inyPrxMXrZ3pK7hu76WnMrQb41QAU3LzKL6YgWmJQQKIVbcubZl4zXEn6+kgNuzYrMTR99vEHpaSVQvcjfq9RaJi+SvsnSaL7C+qCT5PXZeeQj3TuNFVLOqub6ObMMV3/LVqdkiPOcRbc2KHpu+IvMO0HfDlOGOwEhI7ulUGA40IGge+DPDq03bQigAZUNZy+TV7n8EgLNcbxnfvltxoLbTPDQKBgQDkc4ykv2zKPhbDuxxaw9c0FAddYuJMJGsXktEreJfjKDCBWH5kud2qiUXf2rxxx+tie7aKVbxx5I+SKqRwmbfLo2bFp+lOQw23qmvOpM8x6reZkAlnXjUVRwstsXRFGWMfx7p2SFz5OgSdiJnarr6W2PVBUTFFArkUkrXOiCBqAwKBgQCtQcv68X0IsmXkrUK70AJv5A1aHRPOpgXckgK8nmj/tt2+IbUJ3E7PLg1E9fLYW1hlLreSBGxeQWY35r6AzQdWttAI5L8OcDoTmS3k/aNXGWNC0T1l2I12oul2I9gZU8UbMG8xl2Cor7P1FQkdJmmAUVWTTfvWlv9qrFFyVN4C2wKBgA6wd1yoimA+ucwAHgSgDxhkKU0R7KckuFYdtKFs8adDkErg28+yO9SZWwrXz8IpLrN4bPZcKO/R2IF3iHdNCwpnCVawQ0oq+ZjTtnblFgWJqCCRqGkjH5qspMVdYbKHvV3vw8eTQ5cq6d0PSYVMMykT7kEy7U4YrLnr7RDIo/ztAoGAWrWAHjogxFTik/9CWSJmpD4531wp6p9xojGvzSECyB7tqYXsSuVVPZNWzywVoMDyXsc+xOwb8J087zeXtceid/vunzlj7iNDxM8GAEXrJsbb+TejdZcTOXHB2WCa22fIYpvRG52ttaOIDGCfDOv3gH8U1rKVj5wuzaK6YamdMtECgYEAobuBoa7wLcJ/1wl2B/v4B5I6ETb83fczle7kPqS1ikFe5a+Z7hL177HD67Gw8pKqbOiu1CS7eQOv8BIzVWYppLocUX6f+oP3k++J3Qh+uq8LKG+QGrDlC+DhOJo7ogU6Rc0RBJqdivvBX7oQsc6EPr5YK4T7DNAYOrIlmv7dwHk=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmp5gEwYCDl8rmPEOZpg2TJ6XIvWFir3s2deQm2PDkI2AyFCfEHLSbc/97vHguTxnFMUcmu+lZMG3jwEMaF8iE259G0WQEjjZvD27ps45DEBogFWRybJlAp01WI7nSFt0rXJ7Kfkwh2mwgRujnlSaFmSHJjJ4D7o/qlCGk1eB16jC80YBvPfWc0FJVhWhgMtkRreog45M5RC9YlAqW/03HhD4/a0aqQZuxcoNMgkulOmtTB9W9C6lgxHnyxHOUKVzw1YsKXKm52nuYyrP/7Y32cVSMIyt70vbtMezhxeqUrVwl5Ilb8lPkcOzdS4Gk+YijqoN67ebwcTolhB0cgUswwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://34450y5q48.zicp.vip/alipay/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/showOrder.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// logs
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

